#ifndef TNW_SPS_H
#define TNW_SPS_H 1

#ifdef ALONE_TNW_SPS
#include <stdio.h>
#include <math.h>
#include "ApmsApi.h"
#include "Tianwan.h"
#include "Uti_Tianwan.h"
#include "Mov_Tianwan.h"
#define APISPS extern "C" __declspec(dllexport)
#else
#define APISPS extern "C" __declspec(dllimport)
#endif

#define		NUM_POINT			15
#define		SPS_ICI				1
#define		SPS_LOOP			1
#define		SPS_PCU				3
#define		SPS_MODULE			3

#define		NUM_SPS_QUOTES		55
#define		QUO_TP				0
#define		QUO_TP_FA			1
#define		QUO_TP_CC			2
#define		QUO_TP_HC			3
#define		QUO_TP_HP			4
#define		QUO_TV_TP			5
#define		QUO_TV_Z1			6
#define		QUO_TV_Z21			7
#define		QUO_TV_Z23			8
#define		QUO_TV_Z3			9
#define		QUO_TP_CL			10
#define		QUO_TP_CL_CLUS		11
#define		QUO_EXP_CL_Z1_L		12
#define		QUO_EXP_CL_Z1_U		13
#define		QUO_EXP_CL_Z21		14
#define		QUO_EXP_CL_Z23		15
#define		QUO_EXP_CL_Z3		16
#define		QUO_Z1_LOAD_FA_TM	17	
#define		QUO_Z1_LOAD_CF_TM	18
#define		QUO_Z1_LOAD_FA_MM	19
#define		QUO_Z1_LOAD_CJ_MM	20
#define		QUO_Z1_LOAD_CF_MM	21
#define		QUO_Z1_TK13_FA_TM	22
#define		QUO_Z1_TK13_FA_MM	23
#define		QUO_Z1_TK13_CJ_MM	24
#define		QUO_Z1_HECA_PL_TM	25
#define		QUO_Z1_HECA_HC_MM	26
#define		QUO_Z21_FA_TM		27
#define		QUO_Z21_CF_TM		28
#define		QUO_Z21_FA_MM		29
#define		QUO_Z21_CJ_MM		30
#define		QUO_Z21_CF_MM		31
#define		QUO_Z22_FA_TM		32
#define		QUO_Z22_HC_TM		33
#define		QUO_Z22_PL_TM		34
#define		QUO_Z22_FA_MM		35
#define		QUO_Z22_CJ_MM		36
#define		QUO_Z22_HC_MM		37
#define		QUO_Z22_PL_MM		38
#define		QUO_Z23_FFDS_FA_TM	39
#define		QUO_Z23_FFDS_PL_TM	40
#define		QUO_Z23_FFDS_FA_MM	41
#define		QUO_Z23_FFDS_PL_MM	42
#define		QUO_Z23_CLJS_CJ_TM	43
#define		QUO_Z23_CLJS_PL_TM	44
#define		QUO_Z23_CLJS_CJ_MM	45
#define		QUO_Z23_CLJS_PL_MM	46
#define		QUO_Z23_CLVW_PL_TM	47
#define		QUO_Z23_CLVW_CJ_MM	48
#define		QUO_Z23_CLVW_PL_MM	49
#define		QUO_Z3_FA_TM		50
#define		QUO_Z3_FA_MM		51
#define		QUO_Z3_CJ_MM		52
#define		QUO_TV_Z23_CW		53
#define		QUO_TV_Z22			54

APISPS BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved);
APISPS RETSTAT SpSetter(HWND hWnd);
APISPS RETSTAT LoadParam(void);
APISPS RETSTAT CheckMov(TAGIDX tiStart, bool *flag);
APISPS RETSTAT GetZ23X(physPoint p1, physPoint p2, float y, float *x);
APISPS RETSTAT GetZ23Y(physPoint p1, physPoint p2, float x, float *y);
APISPS RETSTAT GetCircX12(physPoint center, float radius, float y, float *x1, float *x2);
APISPS RETSTAT GetCircY12(physPoint center, float radius, float x, float *y1, float *y2);
APISPS RETSTAT SetDefaultLimits(void);
APISPS RETSTAT InsideCircle(physPoint center, float radius, float x, float y, bool *inside);
APISPS RETSTAT GetMMTransPos(OBJTMM mastSit, float *pos);
#endif